<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>成易博客-登陆</title>
    <link rel="stylesheet" th:href="@{/static/css/cinui.css}"/>
    <link rel="stylesheet" th:href="@{/static/layui-v2.6.8/layui/css/layui.css}" media="all">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script th:src="@{/static/layui-v2.6.8/layui/layui.js}" charset="utf-8"></script>
    <script th:src="@{/static/js/jquery-3.6.js}"></script>
    <!--  图标库  -->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/v4-shims.css">
    <!--  vue  -->
    <script th:src="@{/static/js/vue/vue.js}"></script>
    <!-- 引入element样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入element组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

<!--    <div th:replace="/common/common :: common-head">-->

<!--    </div>-->
<!--    -->
    <style>
        .bg-purple {
            background: #4a6b95;
        }
        .bg-purple-light {
            background: #86aafc;
        }
    </style>
</head>
<body style="background: rgb(246,248,244)">
<div id="app" style="margin-top: 5em">

        <el-container>
            <!--       main 主内容区域     -->
            <el-main>
                <el-row type="flex" class="row-bg" justify="center">

                    <el-card class="box-card">

                        <el-empty description="登陆/注册">
                            <!--           点击提示栏开始             -->
                            <el-popover
                                    placement="bottom"
                                    content="登陆即注册,优化体验。建议使用QQ登陆，手机号每天只可登陆五次">
                                <el-button size="mini" round="true" icon="el-icon-info" slot="reference"></el-button>
                            </el-popover>
                            <!--            点击提示栏结束            -->
                        </el-empty>

                        <div th:if="${msg != null && msg != ''}">
                            <el-row type="flex" class="row-bg" justify="center">
                                <el-row type="flex" class="row-bg" justify="center">
                                    <el-col :span="24">
                                        <div th:text="${msg}" style="color: red"></div>
                                    </el-col>
                                </el-row>

                            </el-row>
                        </div>

                        <el-row type="flex" class="row-bg" justify="center">


                            <el-form :model="ruleForm" :rules="rules" id="ruleForm" ref="ruleForm" status-icon="true">

                                <el-row type="flex" class="row-bg" justify="center">
                                    <el-col :span="12" :xs="24">
                                        <el-form-item prop="phone" >
                                            <el-input type="text" id="phone" name="phone" v-model="ruleForm.phone" prefix-icon="el-icon-mobile-phone" placeholder="手机号" onkeyup="this.value=this.value.replace(/[^\d]/g,'') " onafterpaste="this.value=this.value.replace(/[^\d]/g,'')"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>

                                <el-row type="flex" class="row-bg" justify="center">
                                    <el-col :span="12" :xs="24">
                                        <el-form-item prop="code">
                                            <el-row type="flex" class="row-bg" justify="center">
                                                <el-col :span="12">
                                                    <el-input type="text" prefix-icon="el-icon-chat-dot-square" placeholder="验证码" v-model="ruleForm.code">
                                                    </el-input>
                                                </el-col>
                                                <el-col :span="12">
                                                    <el-button type="primary" style="width: 100%" @click="smsCode" :disabled="ruleForm.phone.length != 11">发送短信</el-button>
                                                </el-col>
                                            </el-row>
                                        </el-form-item>
                                    </el-col>
                                </el-row>

                                <el-row type="flex" class="row-bg" justify="center">
                                    <el-col :offset="10">
                                        <el-form-item>
                                            <el-button type="primary" @click="submitForm('ruleForm')">登陆</el-button>
                                            <a th:href="@{/qqLogin}" :push="10" style="margin-left: 5em;color: rgba(245,95,90,0.8)"><img th:src="@{/static/images/bt_white_24X24.png}"></a>
                                        </el-form-item>
                                    </el-col>
                                </el-row>

                            </el-form>
                        </el-row>
                    </el-card>

                </el-row>
            </el-main>
        </el-container>


        <div th:replace="common/common :: #common-bottom"></div>
</div>

<script th:src="@{/static/js/login/login.js}"></script>


<!--<script>-->
<!--    var submit = document.getElementById("submit");//获取注册按钮的id-->
<!--    //验证码发送-->
<!--    function getCode() {-->
<!--        $.post({-->
<!--            url: "getCode",-->
<!--            data: {"phone": $('#phone').val()},-->
<!--            async: true,-->
<!--            success: function (data) {-->
<!--                $('#info2').html(data);//获取后台数据绑定到 div上-->
<!--                var Code = document.getElementById("Code");//获取注册按钮的id-->
<!--                if (data.toString() === '发送成功') {//如果验证码发送成功，则将按钮设置为不可点击-->
<!--                    Code.setAttribute('class', 'layui-btn layui-btn-primary submitStyleButton layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12');-->
<!--                } else {-->
<!--                    Code.setAttribute('class', 'layui-btn layui-btn-normal layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12');-->
<!--                }-->
<!--            }-->
<!--        })-->
<!--    }-->

<!--    //验证码验证-->
<!--    function codeStatus() {-->
<!--        $.post({-->
<!--            url: "codeStatus",-->
<!--            data: {"SmsCode": $('#SmsCode').val()},-->
<!--            async: true,-->
<!--            success: function (data) {-->
<!--                $('#info3').html(data);//获取后台数据绑定到 div-->
<!--                var codeStatus = document.getElementById("SmsCode");-->
<!--                if (data.toString() === '验证码错误') {//验证码错误不允许注册-->
<!--                    submit.setAttribute('class', 'layui-btn layui-btn-primary submitStyleButton layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12');-->
<!--                } else {-->
<!--                    submit.setAttribute('class', 'layui-btn layui-btn-normal layui-col-lg12 layui-col-md12 layui-col-sm12 layui-col-xs12');-->
<!--                }-->
<!--            }-->
<!--        })-->
<!--    }-->
<!--</script>-->

</body>
</html>